import { http } from './http.js';
import { http2 } from './http2.js';
// import * as host from './http.js'
/**
 * 登陆接口
 * @param {Object} leaveUserNum 用户帐号
 * @param {Object} leaveUserPwd 用户密码
 * @param {Object} params
 */
export function appLoginApi(leaveUserNum,leaveUserPwd,params){
	http('/appLogin/'+ leaveUserNum +'/' + leaveUserPwd,'get',params)
}
/**
 * 查询个人信息接口
 * @param {Object} leaveUserNum 用户账号
 * @param {Object} params 可传数据
 */
export function getUserByIdApi(leaveUserNum,params){
	http('/getUserById/'+leaveUserNum,'get',params)
}

// 历史请求
/**
 * @param {Object} params 传递用户名
 * @param {Object} userName
 * 
 */
export function getHistoryApi(leaveUserNum,params){
	http('/getHistory/'+leaveUserNum,'get',params)
}
/**
 * 请假请求
 * @param {Object} params 传递数据
 */
export function applyApi(params){
	http2('/apply','post',params)
}

/**
 * 待审批0，已通过1，已拒绝4 请求
 * @param {Object} params
 */
export function getStatusByTypeApi(leaveUserNum,type,params){
	http('/getStatusByType/'+leaveUserNum+'/'+type,'get',params)
}

/**
 * 当前流程请求 根据请假ID主键审批流程
 * @param {Object} leaveInfoId 请假信息的id
 * @param {Object} params
 */
export function getFurrentFlowApi(leaveInfoId,params){
	http('/getFurrentFlow/'+leaveInfoId,'get',params)
}

/**
 * 修改密码请求
 * @param {Object} leaveUserNum 用户账号
 * @param {Object} pwd 修改后的密码
 * @param {Object} params
 */ 
export function modifyMiApi(leaveUserNum,pwd,params){
	http('/modifyMi/'+leaveUserNum+'/'+pwd,'put',params)
}
/**
 * 编辑资料请求
 * @param {Object} leaveUserNum 用户id
 * @param {Object} params
 */
export function editingMaterialsApi(leaveUserNum,params){
	http2('/editingMaterials'+'/'+leaveUserNum,'put',params)
}

/**
 * 根据ID获取请假详情
 * @param {Object} leaveInfoId 请假ID
 * @param {Object} params
 */
export function getLeaveInfoByIdApi(leaveInfoId,params){
	http('/getLeaveInfoById/'+leaveInfoId,'get',params)
}

/**
 * 根据ID删除请假详情
 * @param {Object} leaveInfoId 请假ID
 * @param {Object} params
 */
export function delLeaveInfoByIdApi(leaveInfoId,params){
	http('/delLeaveInfoById/'+leaveInfoId,'get',params)
}

/**
 * 存档请求
 * 如果是存档请将状态置为5，如果为则默认为待审批即状态为0
 */
export function keepFileApi(params){
	http2('/keepFile','post',params)
}
/**
 * 根据学生学号获取最新请假情况，然后根据请假记录主键获取最新的审批就记录
 * @param {Object} leaveUserNum
 * @param {Object} params
 */
export function getNowFlowByUserNumApi(leaveUserNum,params){
	http('/getNowFlowByUserNum/'+leaveUserNum,'get',params)
}

// 上传附件请求

// 上传图片请求

// 存档请求



